package hcn.protocol.brandnew.feiyong.feiyongqingdan;

import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import hcn.protocol.brandnew.BaseRequest;
import lombok.Data;
import org.atag.sysrouter.annotation.DictionaryMapping;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;
import java.util.List;


/**
 * 门诊费用列表查询-请求信息 - ODS_04030001
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "MsgBody")
@XmlAccessorType(XmlAccessType.FIELD)
public class ListOutpatientExpensesRequest extends BaseRequest {

    /**
     * 医疗机构组织机构代码
     */
    @XmlElement(name = "VisitOrganization")
    private String visitOrganization;
    /**
     * 查询组合类型
     */
    @XmlElement(name = "QueryType")
    private String queryType;
    /**
     * 患者证件集合
     */
    @XmlElementWrapper(name = "IdCardLists")
    @XmlElement(name = "IdCardList")
    private List<IdCardList> idCardLists;
    /**
     * 患者卡集合
     */
    @XmlElementWrapper(name = "MedicalCardLists")
    @XmlElement(name = "MedicalCardList")
    private List<MedicalCardList> medicalCardLists;
    /**
     * 患者ID集合
     */
    @XmlElementWrapper(name = "SourcePatientIdLists")
    @XmlElement(name = "SourcePatientIdList")
    private List<SourcePatientIdList> sourcePatientIdLists;
    /**
     * 费用开始日期时间
     */
    @XmlElement(name = "SettleBeginDateTime")
    @XmlJavaTypeAdapter(DateTimeAdapter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date settleBeginDateTime;
    /**
     * 费用终止日期时间
     */
    @XmlElement(name = "SettleEndDateTime")
    @XmlJavaTypeAdapter(DateTimeAdapter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date settleEndDateTime;
    /**
     * 每页条数
     */
    @XmlElement(name = "PageSize")
    private Long pageSize;
    /**
     * 分页页数
     */
    @XmlElement(name = "PageNo")
    private Long pageNo;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class IdCardList {

        /**
         * 身份证件号码
         */
        @XmlElement(name = "IdCard")
        private String idCard;
        /**
         * 身份证件类别代码
         */
        @XmlElement(name = "IdCardCode")
        @DictionaryMapping(id = "CV02_01_101")
        private String idCardCode;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class MedicalCardList {

        /**
         * 患者卡号
         */
        @XmlElement(name = "MedicalCardId")
        private String medicalCardId;
        /**
         * 诊疗卡类型
         */
        @XmlElement(name = "MedicalCardType")
        @DictionaryMapping(id = "rmp.dic.medicalCardType")
        private String medicalCardType;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class SourcePatientIdList {

        /**
         * 患者ID
         */
        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
    }

}
